package splug.cjk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MessageTab1Content extends Activity{
	
	private TextView tv_content;
	private TextView tv_id;
	private TextView tv_date;
	private String id;
	private String content;
	private String sender;
	private String date;
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.message_tab1_content);
		setTitle("쪽지 내용 확인");
		
		Bundle b = this.getIntent().getExtras();
		id = b.getString("ID");
		content = b.getString("CONTENT");
		sender = b.getString("SENDER");
		date = b.getString("DATE");
		
		tv_content = (TextView) findViewById(R.id.textView_message_content);
		tv_id = (TextView) findViewById(R.id.textView_message_id);
		tv_date = (TextView) findViewById(R.id.textView_message_date);
		Button btn_reply = (Button) findViewById(R.id.btn_message_reply);
		Button btn_back = (Button) findViewById(R.id.btn_message_reply_back);
		
		btn_reply.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(MessageTab1Content.this, MessageTab2.class);
				Bundle b = new Bundle();
				b.putString("ID", id);
				b.putString("RECEIVER", sender);
				intent.putExtras(b);
				startActivity(intent);
			}
		});
		
		btn_back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		tv_content.setText(content);
		tv_id.setText(sender);
		tv_date.setText(date);
	}

}
